package com.hsw.habit.controller;

import com.hsw.habit.frame.annotation.NoLoginRequired;
import com.hsw.habit.model.AdHsBean;
import com.hsw.habit.model.JsonData;
import com.hsw.habit.model.LaunchBean;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Arrays;
import java.util.List;

@RestController
@RequestMapping("/app")
public class AppController {

    final static List<String> IMAGE_ARRAY = Arrays.asList(
            "http://qnoss2.lanlanlife.com/56a1d33f115334352c4a7a9397c02bfc_1646x1080.jpg?imageView2/2/w/420/h/640/format/webp/q/80",
            "http://qnoss3.lanlanlife.com/72be57ddfd78fa5e7195243a4a8e5a70_1646x1080.jpg?imageView2/2/w/420/h/640/format/webp/q/80",
            "http://qnoss3.lanlanlife.com/a2f3135228ca594f90a61cbf0eeb518b_1646x1080.jpg?imageView2/2/w/420/h/640/format/webp/q/80",
            "http://qnoss3.lanlanlife.com/020fc223580c570a5ea7e866ba521d97_1646x1080.jpg?imageView2/2/w/420/h/640/format/webp/q/80",
            "http://qnoss2.lanlanlife.com/175184e23b98f7fa8d5658e8a54ac9e0_1646x1080.jpg?imageView2/2/w/420/h/640/format/webp/q/80",
            "http://qnoss3.lanlanlife.com/ffc44c6c5ebaadbe8c3a8a223a0103dc_1646x1080.jpg?imageView2/2/w/420/h/640/format/webp/q/80",
            "http://qnoss3.lanlanlife.com/d3e12f7e078d2acf8764363d8e49892e_1646x1080.jpg?imageView2/2/w/420/h/640/format/webp/q/80",
            "http://qnoss2.lanlanlife.com/85da3bed3408acc7a4bafe563c0f7b8a_1646x1080.jpg?imageView2/2/w/420/h/640/format/webp/q/80",
            "http://qnoss1.lanlanlife.com/a3bd7a8d53fc27808fc58b48a9dcab4f_1646x1080.jpg?imageView2/2/w/420/h/640/format/webp/q/80",
            "http://qnoss3.lanlanlife.com/ab2975d9b369f7cd19faf63cdc9213c2_1646x1080.jpg?imageView2/2/w/420/h/640/format/webp/q/80",
            "http://qnoss.lanlanlife.com/d6c15f18d8f74be79e93a0c3959efe67_1646x1080.jpg?imageView2/2/w/420/h/640/format/webp/q/80",
            "http://qnoss1.lanlanlife.com/6c76882fb9b801d5e45c91673b35aae3_1646x1080.jpg?imageView2/2/w/420/h/640/format/webp/q/80",
            "http://qnoss.lanlanlife.com/55f6f9792c2b635c58d9e8add9a611c5_1646x1080.jpg?imageView2/2/w/420/h/640/format/webp/q/80",
            "http://qnoss1.lanlanlife.com/4d01455fd36812b5c0508c616450ed0f_1646x1080.jpg?imageView2/2/w/420/h/640/format/webp/q/80",
            "http://qnoss3.lanlanlife.com/f13a89a279bc40ee711d259b29b6f188_1646x1080.jpg?imageView2/2/w/420/h/640/format/webp/q/80",
            "http://qnoss3.lanlanlife.com/dee3791f26306140f988410623387871_1646x1080.jpg?imageView2/2/w/420/h/640/format/webp/q/80",
            "http://qnoss.lanlanlife.com/ea9a8beb6c4fb749b13b7b9a5fc8f458_1646x1080.jpg?imageView2/2/w/420/h/640/format/webp/q/80",
            "http://qnoss2.lanlanlife.com/0fce8e91ede239f5fbdb5c9b11c8372b_1646x1080.jpg?imageView2/2/w/420/h/640/format/webp/q/80",
            "http://qnoss3.lanlanlife.com/7f626e7e4acabac82c363ff8d78d7a2e_1646x1080.jpg?imageView2/2/w/420/h/640/format/webp/q/80",
            "http://qnoss2.lanlanlife.com/4ca1016e785bc58128502bc833f85fea_1646x1080.jpg?imageView2/2/w/420/h/640/format/webp/q/80"
    );

    @NoLoginRequired
    @RequestMapping("/launch")
    JsonData getLaunchData() {
        LaunchBean launchBean = new LaunchBean();
        launchBean.setImageUrl("http://qnoss3.lanlanlife.com/d3e12f7e078d2acf8764363d8e49892e_1646x1080.jpg");
        launchBean.setH(1646);
        launchBean.setW(1080);
        launchBean.setStatus(0);
        launchBean.setLink("/app/extend");
        return JsonData.success(launchBean);
    }

    @NoLoginRequired
    @RequestMapping("/adhs")
    JsonData getAdHs() {
        AdHsBean adHsBean = new AdHsBean();
        adHsBean.setUrls(IMAGE_ARRAY);
        adHsBean.setCode("任务记");
        adHsBean.setLink("https://a.app.qq.com/o/simple.jsp?pkgname=com.xiaoshijie.sqb");
        return JsonData.success(adHsBean);
    }
}
